Software Development
Control Structures in C
Control Structures in C: Getting Started with Control Structures
Control Structures in C: Looping & Unconditional Control Structures

Control Structures in C: Getting Started with Control Structures

Course Number:
it_cpcsfcdj_01_enus
Lesson Objectives

Control Structures in C: Getting Started with Control Structures

  • discover the key concepts covered in this course
  • outline three types of control structures used in the C language
  • demonstrate the use of basic if statements
  • demonstrate the use of relational operators with if statements
  • demonstrate how to use logical operators to chain relational operators
  • identify common gotchas of if statements
  • demonstrate the use of if-else blocks
  • demonstrate the use of nested if-else blocks
  • demonstrate how to run code with nested if-else blocks
  • outline the if-else if control structure
  • demonstrate how to run code with the if-else-if ladder
  • illustrate the mechanics of the switch statement
  • demonstrate how to run code with switch statements
  • demonstrate the use of switch statements in various scenarios
  • demonstrate the use of characters in switch statements
  • demonstrate the use of the ternary operator to shorten if-else blocks
  • summarize the key concepts covered in this course

Overview/Description
A control structure in C is any code construct that changes the flow of control, such as the order of execution in a program. The three main types of control structures in C are decision-making control structures, looping control structures, and unconditional control structures. Decision-making control structures include if-else blocks and switch statements. You will start this course by working with the if statement control structure. This checks whether a condition is satisfied or not, and returns an output based on that. You will then use the if-else-if ladder to create multiple conditions that will be checked in order. The code block associated with the first condition that is satisfied will be executed, and subsequent conditions will not even be checked. Finally, you will learn about the ternary operator, which makes use of the ? and : symbols to create an if-else block and store the result in a variable. Upon completion of this course, you'll be able to work with control structures to change the flow of execution of a C program, use if and else conditions, and employ the ternary operator in assignments and expressions

Target

Prerequisites: none

Control Structures in C: Looping & Unconditional Control Structures

Course Number:
it_cpcsfcdj_02_enus
Lesson Objectives

Control Structures in C: Looping & Unconditional Control Structures

  • discover the key concepts covered in this course
  • illustrate the creation and use of variables of the Boolean type in C
  • illustrate how loop control structures work in C
  • create for loops in C
  • demonstrate the effects of changes to the loop variable and update expression in for loops
  • demonstrate several possible gotchas of for loops
  • demonstrate how to iterate over arrays with for loops
  • demonstrate how to create nested for loops
  • demonstrate how to create while loops
  • demonstrate how to work with while loops
  • demonstrate the use of do-while loops
  • demonstrate how to exit loops with the break statement
  • demonstrate how to use the break statement with while loops
  • demonstrate how to use the continue operator in different scenarios
  • demonstrate how to use the continue operator with while loops
  • demonstrate how to use the goto operator
  • summarize the key concepts covered in this course

Overview/Description
The three main types of looping control structures in C are for loops, while loops, and do-while loops. This course provides demos for how to work with looping and unconditional control structures in C. You will begin by creating a for loop which iterates over a block of code for as long as a certain condition is true. You will then experiment with the loop condition, the value of the loop variable, and the update expression for the loop variable, before moving on to iterating over arrays using for loops. You will also create nested for loops. Next, you will use while loops to execute some code while a condition is satisfied. You will explore the loop variable and iterate over arrays, then move on to do-while loops. Finally, you will learn about the unconditional control structures such as break, continue, goto, and return keywords. These are typically used with other control structures. After completing this course, you'll be able to implement while loops, for loops, do-while loops, break statements, and continue operators.

Target

Prerequisites: none

Close Chat Live